From 3acac648ad6f7c220a48ff9f92f42e814c2097ab Mon Sep 17 00:00:00 2001 From: real-zephex Date: Tue, 26 Mar 2024 13:21:55 +0530 Subject: restructured files --- src/app/video/[animeId]/page.jsx | 56 ---------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/app/video/[animeId]/page.jsx (limited to 'src/app/video/[animeId]/page.jsx') diff --git a/src/app/video/[animeId]/page.jsx b/src/app/video/[animeId]/page.jsx deleted file mode 100644 index c0339f7..0000000 --- a/src/app/video/[animeId]/page.jsx +++ /dev/null @@ -1,56 +0,0 @@ -import { MediaPlayer, MediaProvider } from "@vidstack/react"; -import "@vidstack/react/player/styles/base.css"; -import "@vidstack/react/player/styles/plyr/theme.css"; -import { - PlyrLayout, - plyrLayoutIcons, -} from "@vidstack/react/player/layouts/plyr"; -import "../video.css"; -import { redirect } from "next/navigation"; - -export default async function Video({ params }) { - const id = params.animeId; - - // Getting the episode number and the anime name. Kindly ignore! - const words = id.split("-"); - const last_two = words.slice(-2).join(" "); - const remainingWords = words.slice(0, -2).join(" "); - - const data = await getVideoLink(id); - - if (data.message) { - redirect("/404"); - } - - const link = data.sources[4].url; - - return ( -
-
-

- {last_two} - {remainingWords} -

- - - - -
-
- ); -} - -async function getVideoLink(id) { - const res = await fetch( - "https://consumet-api-di2e.onrender.com/anime/gogoanime/watch/" + id, - { next: { revalidate: 3600 } } // Video links are revalidated after an hour - ); - const data = res.json(); - return data; -} -- cgit v1.2.3